<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <button id="btn">获取余额</button>
    <script src="./js/jquery.min-1.10.2.js"></script>
    <script>
        $("#btn").click(function(){
            //先登录
            $.ajax({
                url:"/api/login.json",
                success(r){
                    console.log('登录信息',r);
                    //获取余额
                    $.ajax({
                        url:"/api/banlance.json",
                        success(r){
                            console.log("余额信息：",r);
                        }
                    })
                }
            })
        })
        /**
         * 解决地狱回调
         * 1,登录
         * r = login()
         * yue = banlance();
         */
    </script>
</body>
</html>